package java_thinking.unit_18_IO._18_1;

import java.io.File;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.Locale;

/**
 * @Desc:
 * @author: cww
 * @DateTime: 2019/5/13 8:55
 */

public class E06_ProcessFiles3 {
    public static void main(String[] args) {
        DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, Locale.CHINESE);
        String[] str = {"java_thinking.unit_18_IO._18_1","1557709750000"};
        long tmp = 0;
        try {
            df.setLenient(false);
            tmp = df.parse(args[1]).getTime();
        } catch (ParseException e) {
            e.printStackTrace();
            return;
        }
        final long modTime = tmp;
        new ProcessFiles(new ProcessFiles.Strategy() {
            @Override
            public void process(File file) {
                if (modTime < file.lastModified()) {
                    System.out.println(file);
                }
            }
        },"java").start(new String[] {str[0]});
    }
}
